<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>${SYSTEM_NAME}</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/js/zTree_v3/css/metroStyle/metroStyle.css?v=${FILE_VERSION}" type="text/css">
</head>
<body>
<div class="layui-fluid" style="background-color: #fff;">
		
  	</div>
<script src="${pageContext.request.contextPath}//staticjs/common-2.0.0.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
<script>
layui.config({
  base: getContextPath() + '/static/layuiadmin/' //静态资源所在路径
}).extend({
  index: 'lib/index' //主入口模块
}).use(['form'], function(){
	var form = layui.form;
	form.verify({
		
	});
	form.on('submit(sub)', function(data){
		$ajax({
			url: "/sys/role/add/save",
			data: data.field,
	        succCallback: function (json) {
              if(json.code == 0){
            		var id = $("#id").val();
            		parent.reload();
            		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
            		parent.layer.close(index);//关闭弹出的子页面窗口
            		parent.layer.msg(json.msg);
            	}
	        }
		});
		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
});

function closed(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
	parent.layer.close(index);//关闭弹出的子页面窗口
}
</script>
</body>
</html>